﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AMS.Core.Data;
using System.Configuration;

namespace AMS.DD35.DbAccess
{
    public class Configuration : IConfiguration
    {
        private string _dataSource;
        private string _userId;
        private string _password;
        private string _database;
        public string Database
        {
            get { return _database; }
        }

        private string _schema;
        public string Schema
        {
            get { return _schema; }
        }

        public Configuration()
        {
            //TODO: replace with use of app.config
            this._dataSource = "tesla";             //ConfigurationManager.AppSettings["datasource"];
            this._userId = "sa";                    //ConfigurationManager.AppSettings["userid"];   // bad!
            this._password = "sqlserverexpress";    //ConfigurationManager.AppSettings["password"]; // bad!
            this._database = "dungeons_dragons_3";  //ConfigurationManager.AppSettings["database"];
            this._schema = "dbo";                   //ConfigurationManager.AppSettings["schema"];
        }

        public string ConnectionString
        {
            get { return String.Format("data source={0};user id={1};password={2};pooling=false;", _dataSource, _userId, _password); }
        }
    }
}
